package com.example.light.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.light.system.dto.deviceTree;
import com.example.light.system.entity.device;
import com.example.light.system.entity.room;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

@Mapper
@Repository
public interface DeviceMapper extends BaseMapper<device> {
    // 联查设备房间名称
    String searchRoomName(@Param("deviceId") Integer deviceId);

    // 查询设备信息
    ArrayList searchDevice(@Param("roomName") String roomName, @Param("deviceName") String deviceName);

    // 通过教室编号查找设备编号和设备名称
    ArrayList<deviceTree> searchDeviceByRoomNumber(@Param("roomNumber") String roomNumber);
}
